﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BCompanyM.aspx.cs" Inherits="BCompanyM" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>公司管理</title>
    <link href="../../CSS/SubStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Jscript/wyyjs.js"></script>
    <script type="text/javascript" language="javascript">
    function boundvalid()
    {
        boundsource("txtCoName","^.+$","名称不能为空","cmdAdd,cmdEdit");
        boundsource("txtCoCode","^.+$","代码不能为空","cmdAdd,cmdEdit");
    }
    </script>

</head>
<body onload="boundvalid();">
    <form id="form1" runat="server">
        <table cellpadding="0" cellspacing="0" class="topTable">
            <tr>
                <td class="topTd">
                    <asp:Label ID="lblLocation" runat="server" Text="<%$ Resources:language, Location %>"></asp:Label><img
                        alt="当前位置" src="../../Image/weizhi.gif" />>><asp:Label ID="Label1" runat="server" Text="<%$ Resources:hwlan, comconfig %>"></asp:Label><asp:Label
                            ID="Label2" runat="server" Text="<%$ Resources:language, Must1 %>"></asp:Label><font
                                color="#ff0000">*</font><asp:Label ID="Label3" runat="server" Text="<%$ Resources:language, Must2 %>"></asp:Label>
                </td>
            </tr>
        </table>
        <fieldset>
            <legend><span style="font-size: 12px;">
                <asp:Label ID="lblLegend1" runat="server" Text="<%$ Resources:language, Legend1 %>"></asp:Label></span></legend>
                <table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;" class="topTdInput">
                                <tr>
                                    <td class="td10" style="width: 10%; height: 10px">
                                    </td>
                                    <td class="td20" style="height: 10px">
                                    </td>
                                    <td class="td10" style="height: 10px">
                                    </td>
                                    <td class="td20" style="height: 10px">
                                    </td>
                                    <td class="td10" style="height: 10px">
                                    </td>
                                    <td class="td20" style="height: 10px">
                                    </td>
                                    <td class="td10" style="height: 10px">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td10" style="width: 10%; height: 21px">
                                        <span color="#ff0000">*</span><asp:Label ID="Label4" runat="server" Text="<%$ Resources:hwlan, ccode %>"></asp:Label>:</td>
                                    <td class="td20" style="height: 21px">
                                        <asp:TextBox ID="txtCoCode" CssClass="txtStyle" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="td10" style="height: 21px">
                                        <span color="#ff0000">*</span><asp:Label ID="Label5" runat="server" Text="<%$ Resources:hwlan, cname %>"></asp:Label>:
                                    </td>
                                    <td class="td20" style="height: 21px">
                                        <asp:TextBox ID="txtCoName" runat="server" CssClass="txtStyle"></asp:TextBox>
                                    </td>
                                    <td class="td10" style="height: 21px">
                                    </td>
                                    <td class="td20" style="height: 21px">
                                    </td>
                                    <td class="td10" style="height: 21px">
                                        </td>
                                </tr>
                                <tr>
                                    <td class="td10" style="width: 10%">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td10" style="width: 10%">
                                        <asp:Label ID="Label6" runat="server" Text="<%$ Resources:hwlan, ctel %>"></asp:Label>:</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtTel" runat="server" CssClass="txtStyle"></asp:TextBox></td>
                                    <td class="td10">
                                        <asp:Label ID="Label7" runat="server" Text="<%$ Resources:hwlan, cfax %>"></asp:Label>:</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtFax" runat="server" CssClass="txtStyle"></asp:TextBox></td>
                                    <td class="td10">
                                        </td>
                                    <td class="td20">
                                        </td>
                                    <td class="td10">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td10" style="width: 10%">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td10" style="width: 10%">
                                        <asp:Label ID="Label8" runat="server" Text="<%$ Resources:hwlan, cadd %>"></asp:Label>:</td>
                                    <td class="td20" colspan="5">
                                        <asp:TextBox ID="txtCoAddress" CssClass="txtStyle" runat="server"></asp:TextBox></td>
                                    <td class="td10">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td10" style="width: 10%">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td10" style="width: 10%">
                                        <asp:Label ID="Label9" runat="server" Text="<%$ Resources:hwlan, desc %>"></asp:Label></td>
                                    <td class="td20" colspan="5">
                                        <asp:TextBox ID="txtDesc" CssClass="txtStyle" runat="server"></asp:TextBox></td>
                                    <td class="td10">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td10" style="width: 10%; height: 12px">
                                    </td>
                                    <td class="td20" style="height: 12px">
                                    </td>
                                    <td class="td10" style="height: 12px">
                                    </td>
                                    <td class="td20" style="height: 12px">
                                    </td>
                                    <td class="td10" style="height: 12px">
                                    </td>
                                    <td class="td20" style="height: 12px">
                                    </td>
                                    <td class="td10" style="height: 12px">
                                    </td>
                                </tr>
                            </table>
                <div class="cmdButtonsDiv">
                            &nbsp;<asp:Button ID="cmdAdd" runat="server" Text="<%$ Resources:hwlan, insert %>"
                                CssClass="cmdStyle" OnClick="cmdAdd_Click" />
                            &nbsp;<asp:Button ID="cmdEdit" runat="server" Text="<%$ Resources:hwlan, edit %>"
                                CssClass="cmdStyle" Enabled="False" OnClick="cmdEdit_Click" />
                        <asp:Button ID="Button1" runat="server" Text="<%$ Resources:hwlan, reset %>"
                                CssClass="cmdStyle" OnClick="Button1_Click" />
                </div>            
        </fieldset>
        <fieldset>
            <legend><span style="font-size: 12px;">
                <asp:Label ID="lblLegend2" runat="server" Text="<%$ Resources:language, Legend2 %>"></asp:Label></span></legend>
                <div class="grvDiv">
                    <asp:GridView ID="gvCo" runat="server" Width="100%" AutoGenerateColumns="False" CssClass="gvStyle"
                        AllowPaging="true" GridLines="none" PageSize="20" OnRowDeleting="gvCo_RowDeleting"
                        OnRowDataBound="gvCo_RowDataBound" 
                        OnPageIndexChanging="gvCo_PageIndexChanging" 
                        onselectedindexchanged="gvCo_SelectedIndexChanged">
                        <HeaderStyle CssClass="gvHeader" />
                        <RowStyle CssClass="gvRow" />
                        <AlternatingRowStyle CssClass="gvAllRow" />
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    NO.</HeaderTemplate>
                                <ItemTemplate>
                                   <%#gvCo.PageIndex * gvCo.PageSize + gvCo.Rows.Count + 1%>
                                </ItemTemplate>
                                <ItemStyle CssClass="gvItem" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="CoCode" HeaderText="公司编号">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="CoName" HeaderText="公司名称">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="CoTel" HeaderText="<%$ Resources:hwlan, ctel %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="CoFax" HeaderText="<%$ Resources:hwlan, cfax %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="CoAddress" HeaderText="<%$ Resources:hwlan, cadd %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="CoDesc" HeaderText="<%$ Resources:hwlan, desc %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:CommandField HeaderText="<%$ Resources:language, Edit %>" ShowSelectButton="true"
                                SelectText="&lt;img border=0 alt=&quot;Edit&quot; src=../../Image/edit.gif&gt;">
                                <ItemStyle CssClass="gvItem" />
                            </asp:CommandField>
                            <asp:CommandField ShowDeleteButton="True" DeleteText="&lt;img border=0 alt=&quot;Delete&quot; src=../../Image/del.gif&gt;"
                                HeaderText="<%$ Resources:language, Delete %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:CommandField>
                        </Columns>
                        <PagerTemplate>
                            <table style="text-align: center;">
                                <tr>
                                    <td>
                                        <asp:Label ID="LabelCurrentPage" runat="server" Font-Size="Small">当前显示第<%# ((GridView)Container.NamingContainer).PageIndex + 1 %>页</asp:Label></td>
                                    <td>
                                        <asp:Label ID="LabelPageCount" runat="server" Font-Size="Small">&nbsp; 共有<%# ((GridView)Container.NamingContainer).PageCount %>页</asp:Label></td>
                                    <td>
                                        <asp:LinkButton ID="LinkButtonFirstPage" runat="server" CommandArgument="First" CommandName="Page"
                                            Font-Underline="False" Enable="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>"
                                            Font-Size="Small">&nbsp; 首页</asp:LinkButton></td>
                                    <td>
                                        <asp:LinkButton ID="LinkButtonPreviousPage" runat="server" CommandArgument="Prev"
                                            Font-Underline="False" CommandName="Page" Enable="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>"
                                            Font-Size="Small">&nbsp;上一页</asp:LinkButton></td>
                                    <td>
                                        <asp:LinkButton ID="LinkButtonNextPage" runat="server" CommandArgument="Next" CommandName="Page"
                                            Font-Underline="False" Enable="<%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>"
                                            Font-Size="Small">&nbsp;下一页</asp:LinkButton></td>
                                    <td>
                                        <asp:LinkButton ID="LinkButtonLastPage" runat="server" CommandArgument="Last" CommandName="Page"
                                            Font-Underline="False" Enable="<%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>"
                                            Font-Size="Small">&nbsp;尾页</asp:LinkButton></td>
                                </tr>
                            </table>
                        </PagerTemplate>
                    </asp:GridView>
                </div>
        </fieldset>
        <asp:HiddenField ID="hidid" runat="server" />
        <asp:HiddenField ID="hidname" runat="server" />    
    </form>
</body>
</html>
